class Timer{
	
	public: 
		Timer(int M)
		{
			_M=M;
			_begin=0;
			_nstep=100;
			_char=_nstep+6;
			cout << "\n";
		}
		void Progress(int j)
		{
	
				if(_begin==1)
				{
					for(int i=0;i<_char;i++)
					{
						cout << "\b";
					}
				}
				cout << "|";
				for(int i=0;i<_nstep;i++)
				{
					if(i<(int)(((double)j/_M)*100))
					{
						cout << "=";
					}else{
						cout << " ";
					}
				}
				cout << "| " << (int)(((double)j/_M)*100) << "%";
				_begin=1;
		

		}
	private:
		int _M;
		int _begin;
		int _nstep;
		int _char;
};
